<!-- NewPracticeMine_frame.html -->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>我的实习frame</title>
    <link rel="stylesheet" href="../../css/api.css" />
	<link rel="stylesheet" href="../../css/mui.min.css"/>
	<link rel="stylesheet" href="../../css/base.css"/>
	<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
	<link rel="stylesheet" href="../../css/newPractice.css">
	<style type="text/css">
		.switch-tab{
			padding-bottom: 6px;
			margin-right: 10px;
		}
		.switch-active{
			border-bottom: 2px solid #f16b6f;
		}
		.practice-tab-subview .tab-btn{
			padding: 0 6px;
			height: 30px;
		}
		.btn-span{
			text-overflow: ellipsis;
			width: 100%;
			overflow: hidden;
			line-height: 28px;
		}
	</style>
</head>
<body>
	<div name="conten_div">
		<!-- 轮播图 -->
		<div id="train_slider" class="mui-slider rotation-div" >
			<div id="rotation" class="mui-slider-group mui-slider-loop">
				<!-- <div class="mui-slider-item mui-slider-item-duplicate">
					<a href="#">
						<img class="rotation-img" src="../../image/course_placehoder.png">
					</a>
				</div>
				<div class="mui-slider-item">
					<a href="#">
						<img class="rotation-img" src="../../image/course_placehoder.png">
					</a>
				</div>
				<div class="mui-slider-item mui-slider-item-duplicate">
					<a href="#">
						<img class="rotation-img" src="../../image/course_placehoder.png">
					</a>
				</div> -->
			</div>
			<div id="noRotation" hidden="hidden">
				<div class="rotation-cell">
					<!-- <a href="#"> -->
						<img class="rotation-img" style="display: block;" src="../../image/firstNewsTitls2.png">
					<!-- </a> -->
				</div>
			</div>
			<div id="pageControl" class="mui-slider-indicator">
				<!-- <div class="mui-indicator mui-active"></div> -->
			</div> 
		</div>
		<div class="hot-news-title">
			<img src="../../image/icon_01.png" alt="" class="hot-news-title-img">
			<span class="base_dark_grey_shallow base_content_font hot-news-title-span">
				轮岗岗位
			</span>
			<span id="more_post" onclick="morePost()" class="train-more base_grey base_tag_font" style="display: none;">
				更多 &#62
			</span>
		</div>
		<div class="mui-table-view">
			<div id="post_tableview" class="practice-tab-div">
				<!-- <div class="practice-tab-box">
					<div class="practice-tab">
						<div class="practice-tab-subview practice-tab-title">
							<button type="button" class="mui-btn mui-btn-block tab-btn">
								<span class="btn-span">
									仓储规划岗仓储规划岗		
								</span>
							</button>
						</div>
					</div>
				</div> -->
			</div>
		</div>
		<div class="hot-news-title">
			<img src="../../image/icon_02.png" alt="" class="hot-news-title-img">
			<span class="base_dark_grey_shallow base_content_font hot-news-title-span">
				热门企业
			</span>
			<span id="more_company" onclick="moreCompany()" class="train-more base_grey base_tag_font" style="display: none;">
				更多 &#62
			</span>
		</div>
		<div class="mui-table-view">
			<div id="company_tableview" class="hot-company-content-div">
				<!-- <div class="content-box">
					<li class="mui-table-view-cell mui-media content-sub-div">
						<a href="javascript:;" class="hot-c-a">
							<div class="hotc-sub-left-div">
								<img src="../../image/icon_sina_new.png" class="hot-company-img">
							</div>
							<div class="hotc-sub-right-div">
								<p class="hot-c-title">
									顺丰速递
								</p>
								<p class="hot-c-type">
									企业类型:物流
								</p>
								<p class="hot-c-type">
									实习岗位:仓储/物流
								</p>
							</div>
						</a>
					</li>
				</div>
				<div class="content-box">
					<li class="mui-table-view-cell mui-media content-sub-div">
						<a href="javascript:;" class="hot-c-a">
							<div class="hotc-sub-left-div">
								<img src="../../image/icon_sina_new.png" class="hot-company-img">
							</div>
							<div class="hotc-sub-right-div">
								<p class="hot-c-title">
									顺丰速递
								</p>
								<p class="hot-c-type">
									企业类型:物流
								</p>
								<p class="hot-c-type">
									实习岗位:仓储/物流
								</p>
							</div>
						</a>
					</li>
				</div> -->
			</div>
		</div>
		<div class="hot-news-title">
			<img src="../../image/icon_03.png" alt="" class="hot-news-title-img">
			<span id="xiangguanhuodong" class="base_dark_grey_shallow base_content_font hot-news-title-span switch-tab switch-active">
				相关活动
			</span>
			<span id="remenpeixun" class="base_dark_grey_shallow base_content_font hot-news-title-span switch-tab">
				热门培训
			</span>
			<span id="remenrenzheng" class="base_dark_grey_shallow base_content_font hot-news-title-span switch-tab">
				热门认证
			</span>
			<span id="more_news" onclick="moreNews()" class="train-more base_grey base_tag_font" style="display: none;">
				更多 &#62
			</span>
		</div>
		<div class="train-div mui-table-view">
			<ul id="xiangguanhuodong_list" class="mui-table-view">
				<!-- <li class="mui-table-view-cell mui-media">
					<a href="javascript:;"> 
						<img class="mui-media-object mui-pull-left course-img" src="../../image/list-default.png"/>
						<div class="mui-media-body top-content">
							<p class="course_title">活动</p>
							<span class="right-time-title">
								2019.01.01
							</span>
						</div>
						<div class="mui-media-body bottom-content">
							<div class="">
								<p class="mui-ellipsis subtitle">
									活动
								</p>
							</div>
						</div>
					</a>
				</li> -->
				<div class="noSign" hidden="hidden" id="noData1">
					<img src="../../image/icon_img.png" width="60%">
					<p class="font16 top_15 base_dark_grey" >
						暂无数据
					</p>
				</div>
				<div class="loadFailure" hidden="hidden" id="noNet1">
					<img src="../../image/icon_img01.png" width="60%">
					<p class="" >
						数据加载失败
					</p>
					<p>
						请检查您的网络
					</p>
					<button type="button" class="mui-btn mui-btn-outlined" onclick="loadNews0()">
						重新加载
					</button>
				</div>
			</ul>
			<ul id="remenpeixun_list" class="mui-table-view" style="display: none;">
				<!-- <li class="mui-table-view-cell mui-media">
					<a href="javascript:;"> 
						<img class="mui-media-object mui-pull-left course-img" src="../../image/list-default.png"/>
						<div class="mui-media-body top-content">
							<p class="course_title">培训</p>
							<span class="right-time-title">
								2019.01.01
							</span>
						</div>
						<div class="mui-media-body bottom-content">
							<div class="">
								<p class="mui-ellipsis subtitle">
									培训
								</p>
							</div>
						</div>
					</a>
				</li> -->
				<div class="noSign" hidden="hidden" id="noData2">
					<img src="../../image/icon_img.png" width="60%">
					<p class="font16 top_15 base_dark_grey" >
						暂无数据
					</p>
				</div>
				<div class="loadFailure" hidden="hidden" id="noNet2">
					<img src="../../image/icon_img01.png" width="60%">
					<p class="" >
						数据加载失败
					</p>
					<p>
						请检查您的网络
					</p>
					<button type="button" class="mui-btn mui-btn-outlined" onclick="loadNews1()">
						重新加载
					</button>
				</div>
			</ul>
			<ul id="remenrenzheng_list" class="mui-table-view" style="display: none;">
				<!-- <li class="mui-table-view-cell mui-media">
					<a href="javascript:;"> 
						<img class="mui-media-object mui-pull-left course-img" src="../../image/list-default.png"/>
						<div class="mui-media-body top-content">
							<p class="course_title">认证</p>
							<span class="right-time-title">
								2019.01.01
							</span>
						</div>
						<div class="mui-media-body bottom-content">
							<div class="">
								<p class="mui-ellipsis subtitle">
									认证
								</p>
							</div>
						</div>
					</a>
				</li> -->
				<div class="noSign" hidden="hidden" id="noData3">
					<img src="../../image/icon_img.png" width="60%">
					<p class="font16 top_15 base_dark_grey" >
						暂无数据
					</p>
				</div>
				<div class="loadFailure" hidden="hidden" id="noNet3">
					<img src="../../image/icon_img01.png" width="60%">
					<p class="" >
						数据加载失败
					</p>
					<p>
						请检查您的网络
					</p>
					<button type="button" class="mui-btn mui-btn-outlined" onclick="loadNews2()">
						重新加载
					</button>
				</div>
			</ul>
		</div>
	</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/mui.min.js"></script>
<script type="text/javascript" src="../../script/MD5.js"></script>
<script type="text/javascript" src="../../script/requestTool.js"></script>
<script type="text/javascript" src="../../script/timeStampTool.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
	mui.init({});
</script>
<script type="text/javascript">
	var rotationArr = new Array();//轮播图数据
	var postArr = new Array();//岗位列表
	var companyArr = new Array();//企业列表
	var xghdArr = new Array();//相关活动列表
	var rmpxArr = new Array();//热门培训列表
	var rmrzArr = new Array();//热门认证列表
	var page0 = 1;//全部分页
	var page1 = 1;
	var page2 = 1;
	var rows = 10;
	var dropRefreshCount0 = 0;
	var dropRefreshCount1 = 0;
	var dropRefreshCount2 = 0;
	var trainStatus = 0;//默认相关活动
	var uid;
    var jid;
    var currentPost = null;
    var loadDataStatus = 0;
    $(document).ready(function(){
    	$('.switch-tab').click(function(){
    		var isActive = $(this).hasClass('switch-active');
    		if (isActive == false) {//未选中
    			$('.switch-tab').removeClass('switch-active');
    			$(this).addClass('switch-active');
    			if ($(this).attr('id') == 'xiangguanhuodong') {
    				trainStatus = 0;
    				$('#xiangguanhuodong_list').show();
					$('#remenpeixun_list').hide();
					$('#remenrenzheng_list').hide();
    			}else if($(this).attr('id') == 'remenpeixun'){
    				trainStatus = 1;
    				$('#remenpeixun_list').show();
					$('#xiangguanhuodong_list').hide();
					$('#remenrenzheng_list').hide();
    			}else{//remenrenzheng
    				trainStatus = 2;
    				$('#remenrenzheng_list').show();
					$('#xiangguanhuodong_list').hide();
					$('#remenpeixun_list').hide();
    			}
    		}
    	});
    });
	apiready = function(){
		prepareData();
		setPullUpRefresh();
		loadData();
		setupNotifi();
	}  
	function setupNotifi(){
		api.addEventListener({
		    name: 'practiceApplySucceedNotifi'
		}, function(ret, err) {
		    if (currentPost != null) {
		    	var postData = ret.value;
		    	var postid = postData.id;
		    	if (postid == currentPost.id) {
		    		currentPost.apply_status = 1;
		    	}
		    }
		});
	}
	function prepareData(){
        uid = $api.getStorage('cfnetppuid');
        jid = $api.getStorage('cfnetppjxid');
    }
    function refreshData(){
		loadData();
    }
	function loadData(){
		api.showProgress({
		    style: 'default',
		    animationType: 'fade',
		    title: '数据加载中...',
		    text: '',
		    modal: false
		});
		loadRotationData();
		loadPostListData();
		loadCompanyData();
		loadNews0();
		loadNews1();
		loadNews2();
	}
	function setupLoadDataStatus(){
		loadDataStatus++;
		if (loadDataStatus == 6) {
			api.hideProgress();
		}
	}
	function loadNews0(){
		loadNewsData(page0, 0, function(loadStatus, newsArr){
			if (loadStatus == 1) {
				$('#noData1').hide();
				$('#noNet1').hide();
				var oldCount = xghdArr.length;
				xghdArr = xghdArr.concat(newsArr);
				var newCount = xghdArr.length;
				for (var i = oldCount; i < newCount; i++) {
					var newsData = xghdArr[i];
					$('#xiangguanhuodong_list').append(newsCellHtml(i, newsData, 0));
				}
				setupNewsCellClick();
			}else if(loadStatus == 2){
				if (page0 == 1) {
					$('#noData1').show();
					$('#noNet1').hide();
				}
			}else{
				if (page0 == 1) {
					$('#noData1').hide();
					$('#noNet1').show();
				}
			}
		});
	}
	function loadNews1(){
		loadNewsData(page1, 1, function(loadStatus, newsArr){
			if (loadStatus == 1) {
				$('#noData2').hide();
				$('#noNet2').hide();
				var oldCount = rmpxArr.length;
				rmpxArr = rmpxArr.concat(newsArr);
				var newCount = rmpxArr.length;
				for (var i = oldCount; i < newCount; i++) {
					var newsData = rmpxArr[i];
					$('#remenpeixun_list').append(newsCellHtml(i, newsData, 1));
				}
				setupNewsCellClick();
			}else if(loadStatus == 2){
				if (page1 == 1) {
					$('#noData2').show();
					$('#noNet2').hide();
				}
			}else{
				if (page1 == 1) {
					$('#noData2').hide();
					$('#noNet2').show();
				}
			}
		});
	}
	function loadNews2(){
		loadNewsData(page2, 2, function(loadStatus, newsArr){
			if (loadStatus == 1) {
				$('#noData3').hide();
				$('#noNet3').hide();
				var oldCount = rmrzArr.length;
				rmrzArr = rmrzArr.concat(newsArr);
				var newCount = rmrzArr.length;
				for (var i = oldCount; i < newCount; i++) {
					var newsData = rmrzArr[i];
					$('#remenrenzheng_list').append(newsCellHtml(i, newsData, 2));
				}
				setupNewsCellClick();
			}else if(loadStatus == 2){
				if (page2 == 1) {
					$('#noData3').show();
					$('#noNet3').hide();
				}
			}else{
				if (page2 == 1) {
					$('#noData3').hide();
					$('#noNet3').show();
				}
			}
		});
	}
	// 上拉加载
	function setPullUpRefresh() {
		api.addEventListener({
			name : 'scrolltobottom'
		}, function(ret, err) {
			if (trainStatus == 0) {//相关活动
				if (dropRefreshCount0 >= rows) {
					dropRefreshCount0 = 0;//防止跳页刷新
					page0++;
					loadNews0();
				}
			}else if(trainStatus == 1){//热门培训
				if (dropRefreshCount1 >= rows) {
					dropRefreshCount1 = 0;//防止跳页刷新
					page1++;
					loadNews1();
				}
			}else{
				if (dropRefreshCount2 >= rows) {//热门认证
					dropRefreshCount2 = 0;//防止跳页刷新
					page2++;
					loadNews2();
				}
			}
		});
	}
	function setupNewsCellClick(){
		$('.mui-table-view-cell').unbind('click');
		$('.mui-table-view-cell').click(function(){
			if (api.connectionType == "none") {
				api.toast({
				    msg: '网络异常，请检查网络！'
				});
				return;
			}
			var index = $(this).attr('index');
			var type = $(this).attr('type');
			var newsData;
			if (type == 0) {
				newsData = xghdArr[parseInt(index)];
			}else if(type == 1){
				newsData = rmpxArr[parseInt(index)];
			}else{
				newsData = rmrzArr[parseInt(index)];
			}
			if (newsData.url != undefined && newsData.url != null && newsData.url != '') {
				newsData["detail"] = newsData.url;
				api.openWin({useWKWebView:true,
				    name: 'Teacher_TrainNewsDetail',
				    url: '../Teacher_Teach/Teacher_TrainNewsDetail.html',
				    pageParam: newsData
				});
			}
		});
	}
	function newsCellHtml(index, data, type){
		var imageurl = data.imageurl;
		if (imageurl == null || imageurl == "") {
			imageurl = '../../image/course_placehoder.png'
		}
		var title = data.title;
		var desc = data.desc;
		var time = timePointStringWithTimeStamp(data.time);
		return '<li index="'+index+'" type="'+type+'" class="mui-table-view-cell mui-media">\
					<a href="javascript:;">\
						<img class="mui-media-object mui-pull-left course-img" src="'+imageurl+'"/>\
						<div class="mui-media-body top-content">\
							<p class="course_title">"'+title+'"</p>\
							<span class="right-time-title">'+
								time+
							'</span>\
						</div>\
						<div class="mui-media-body bottom-content">\
							<div class="">\
								<p class="mui-ellipsis subtitle">'+
									desc+
								'</p>\
							</div>\
						</div>\
					</a>\
				</li>';
	}
	//加载资讯数据
	function loadNewsData(type, page, callback){
		var params = {
			type : type,
			page : page,
			rows : rows
		};
		cfnetppPOST(url_newPracticeNewsList, params, true, function(data, status){
			setupLoadDataStatus();
			if (status == 'success') {
				if (data.code == 200) {
					var newArr = data.data;
					if (newArr != undefined && newArr != null && newArr.constructor == Array && newArr.length > 0) {
						if (callback) {
							callback(1, newArr);//1有数据
						}
					}else{
						if (callback) {
							callback(2, null);//2无数据
						}
					}
				}else{
					if (callback) {
						callback(2, null);//2无数据
					}
				}
			}else{
				if (callback) {
					callback(0, null);//0无网络
				}
			}
		});
	}
	//加载企业列表
	function loadCompanyData(){
		var params = {
			page : 1,
			rows : 4
		};
		cfnetppPOST(url_newpracticeCompanyList, params, true, function(data, status){
			setupLoadDataStatus();
			if (status == "success") {
				if (data.code == 200) {
					var jsonData = data.data;
					var total = jsonData.total;
					if (total > 4) {
						$('#more_company').show();
					}else{
						$('#more_company').hide();
					}
					var company_list = jsonData.company_list;
					if (company_list != undefined && company_list != null && company_list.constructor == Array && company_list.length > 0) {
						companyArr = company_list;
						setupCompanyHtml();
					}
				}
			}
		});
	}
	function setupCompanyHtml(){
		for (var i = 0; i < companyArr.length; i++) {
			var companyData = companyArr[i];
			$('#company_tableview').append(companyCellHtml(i, companyData));
		}
		setupCompanyCellClick();
	}
	function setupCompanyCellClick(){
		$('.content-box').unbind('click');
		$('.content-box').click(function(){
			var index = $(this).attr('index');
			var companyData = companyArr[parseInt(index)];
			api.openWin({useWKWebView:true,
			    name: 'NewPracticeCompanyDetail_win',
			    url: 'NewPracticeCompanyDetail_win.html',
			    pageParam: {
			    	id : companyData.companyid
			    }
			});
		});
	}
	//企业cell代码
	function companyCellHtml(index, data){
		var companyname = data.company_name;
		var company_type = data.company_type;
		var companytype = "企业类型:" + company_type;
		if (company_type == null) {
			companytype = "企业类型:--";
		}
		var logoImg = data.company_logo;
		if (logoImg == null || logoImg == '') {
			logoImg = '../../image/course_placehoder.png'
		}
		var companypost = "实习岗位:--";
		var post_list = data.post_list;
		if (post_list.length > 0) {
			companypost = "实习岗位:"
			for (var i = 0; i < post_list.length; i++) {
				var postname = post_list[i].post_name;
				companypost  = companypost + postname + '/';
				if (i == 2) {
					break;
				}
			}
			companypost = companypost.substring(0, companypost.length - 2);
		}
		return '<div index="'+index+'" class="content-box">\
					<li class="mui-table-view-cell mui-media content-sub-div">\
						<a href="javascript:;" class="hot-c-a">\
							<div class="hotc-sub-left-div">\
								<img src="'+logoImg+'" class="hot-company-img">\
							</div>\
							<div class="hotc-sub-right-div">\
								<p class="hot-c-title">'+
									companyname+
								'</p>\
								<p class="hot-c-type">'+
									companytype+
								'</p>\
								<p class="hot-c-type">'+
									companypost+
								'</p>\
							</div>\
						</a>\
					</li>\
				</div>';
	}
	//加载轮岗岗位列表
	function loadPostListData(){
		var params = {
			page : 1,
			rows : 9,
			uid : $api.getStorage('cfnetppuid')
		};
		cfnetppPOST(url_newPracticePostList, params, true, function(data, status){
			setupLoadDataStatus();
			if (status == "success") {
				if (data.code == 200) {
					var jsonData = data.data;
					var total = jsonData.total;
					if (total > 9) {
						$('#more_post').show();
					}else{
						$('#more_post').hide();
					}
					var post_list = jsonData.post_list;
					if (post_list != undefined && post_list != null && post_list.constructor == Array && post_list.length > 0) {
						postArr = post_list;
						setupPostHtml();
					}
				}
			}
		});
	}
	function setupPostCellClick(){
		$('.practice-tab-box').unbind('click');
		$('.practice-tab-box').click(function(){
			var index = $(this).attr('index');
			var postData = postArr[parseInt(index)];
			if (postData.apply_status == 1) {
				api.toast({
				    msg: '已申请该岗位，请耐心等待工作人员联系'
				});
				return;
			}
			currentPost = postData;
			api.openWin({useWKWebView:true,
			    name: 'NewPracticeApply_win',
			    url: 'NewPracticeApply_win.html',
			    pageParam: postData
			});
		});
	}
	function setupPostHtml(){
		for (var i = 0; i < postArr.length; i++) {
			var postObj = postArr[i];
			$('#post_tableview').append(postCellHtml(i, postObj));
		}
		setupPostCellClick();
	}
	function postCellHtml(index, data){
		return '<div index="'+index+'" class="practice-tab-box">'+
					'<div class="practice-tab">'+
						'<div class="practice-tab-subview practice-tab-title">'+
							'<button type="button" class="mui-btn mui-btn-block tab-btn">'+
									'<span class="btn-span">'+
										data.post_name+
									'</span>'+
								'</button>'+
						'</div>'+
					'</div>'+
				'</div>';
	}
	//加载轮播图数据
	function loadRotationData() {
		var params = {};
		// alert('url:'+url_trainRotation+'\n'+JSON.stringify(params));
		cfnetppPOST(url_newPracticeRotation, params, true, function(data, status){
			setupLoadDataStatus();
			if (status == "success") {
				if (data.code == 200) {
					var news = data.data.news;
					if (news != undefined && news != null && news.constructor == Array && news.length > 0) {
						rotationArr = news;
						setupRotationData();
					}
				}
			}
		});
	}
	//设置轮播图数据
	function setupRotationData(){
		if (rotationArr.length == 1) {
			var rotationHtml = '';
			rotationHtml = noRotationHtmlString(0, rotationArr[0]);
			$('#noRotation').html(rotationHtml);
			$('#noRotation').show();
			$('#rotation').hide();
		}else{
			var rotationHtml = '';
			//额外增加的一个节点(循环轮播：第一个节点是最后一张轮播)
			var lastIndex = rotationArr.length - 1;
			var rotationLastData = rotationArr[lastIndex];
			rotationHtml += firstLastImgHtml(lastIndex, rotationLastData);
			//遍历数组
			for (var i = 0; i < rotationArr.length; i++) {
				var rotationData = rotationArr[i];
				rotationHtml += rotationHtmlString(i, rotationData);
			}
			//额外增加的一个节点(循环轮播：最后一个节点是第一张轮播)
			var firstIndex = 0;
			var rotationFirstData = rotationArr[firstIndex];
			rotationHtml += firstLastImgHtml(firstIndex, rotationFirstData);
			//设置轮播图代码
			$('#rotation').html(rotationHtml);
			//设置page Control
			$('#pageControl').html(pageControlHtml(rotationArr.length));
			//设置自动轮播
			setupAutoRotation();
			$('#noRotation').hide();
			$('#rotation').show();
		}
		//设置轮播图点击事件
		setupRotationCellClick();
	}
	function setupRotationCellClick(){
		$('.rotation-cell').unbind('click');
		$('.rotation-cell').click(function(event) {
			if (api.connectionType == "none") {
				api.toast({
				    msg: '网络异常，请检查网络！'
				});
				return;
			}
			var index = $(this).attr('index');
			var rotationData = rotationArr[parseInt(index)];
			if (rotationData.detail != null && rotationData.detail != '') {
				api.openWin({useWKWebView:true,
				    name: 'Teacher_TrainNewsDetail',
				    url: '../Teacher_Teach/Teacher_TrainNewsDetail.html',
				    pageParam: rotationData
				});
			}
		});
	}
	//分页html
	function pageControlHtml(count){
		var pageControl = '';
		pageControl += '<div class="mui-indicator mui-active"></div>';
		for (var i = 1; i < count; i++) {
			pageControl += '<div class="mui-indicator"></div>';
		}
		return pageControl;
	}
	//轮播图首尾
	function firstLastImgHtml(index, data){
		return '<div index="'+index+'" class="rotation-cell mui-slider-item mui-slider-item-duplicate">'+
					'<a href="#">'+
						'<img class="rotation-img" src="'+data.image+'">'+
					'</a>'+
				'</div>';
	}
	//轮播图
	function rotationHtmlString(index, data){
		return '<div index="'+index+'" class="rotation-cell mui-slider-item">'+
					'<a href="#">'+
						'<img class="rotation-img" src="'+data.image+'">'+
					'</a>'+
				'</div>';
	}
	//不轮播的cell
	function noRotationHtmlString(index, data){
		return '<div index="'+index+'" class="rotation-cell">'+
					'<img class="rotation-img" style="display: block;" src="'+data.image+'">'+
				'</div>';
	}
	function setupAutoRotation(){
		var slider = mui("#train_slider");
		slider.slider({
			interval: 3000
		});
	}
	//更多动态
	function moreDongTai(){
		api.openWin({useWKWebView:true,
		    name: 'Teacher_TrainDongTaiListWin',
		    url: 'Teacher_TrainDongTaiListWin.html'
		});
	}
	function morePost(){
		api.openWin({useWKWebView:true,
		    name: 'NewPracticePostList_win',
		    url: 'NewPracticePostList_win.html'
		});
	}
	function moreCompany(){
		api.openWin({useWKWebView:true,
		    name: 'NewPracticeCompanyList_win',
		    url: 'NewPracticeCompanyList_win.html'
		});
	}
</script>
</html>